//
// CPSConstraintMesh.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CPSConstraintMesh {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CPSConstraintMesh(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSConstraintMesh obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSConstraintMesh(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CPSConstraintMesh() {
    this(nel3dJNI.new_CPSConstraintMesh(), true);
  }

  public void setShape(String meshFileName) {
    nel3dJNI.CPSConstraintMesh_setShape__SWIG_0(swigCPtr, this, meshFileName);
  }

  public String getShape() {
    return nel3dJNI.CPSConstraintMesh_getShape__SWIG_0(swigCPtr, this);
  }

  public void setShapes(SWIGTYPE_p_std__string shapesNames, long numShapes) {
    nel3dJNI.CPSConstraintMesh_setShapes(swigCPtr, this, SWIGTYPE_p_std__string.getCPtr(shapesNames), numShapes);
  }

  public void setShape(long index, String shapeName) {
    nel3dJNI.CPSConstraintMesh_setShape__SWIG_1(swigCPtr, this, index, shapeName);
  }

  public String getShape(long index) {
    return nel3dJNI.CPSConstraintMesh_getShape__SWIG_1(swigCPtr, this, index);
  }

  public long getNumShapes() {
    return nel3dJNI.CPSConstraintMesh_getNumShapes(swigCPtr, this);
  }

  public void getShapesNames(SWIGTYPE_p_std__string shapesNames) {
    nel3dJNI.CPSConstraintMesh_getShapesNames(swigCPtr, this, SWIGTYPE_p_std__string.getCPtr(shapesNames));
  }

  public void setMorphValue(float value) {
    nel3dJNI.CPSConstraintMesh_setMorphValue(swigCPtr, this, value);
  }

  public float getMorphValue() {
    return nel3dJNI.CPSConstraintMesh_getMorphValue(swigCPtr, this);
  }

  public void setMorphScheme(SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t scheme) {
    nel3dJNI.CPSConstraintMesh_setMorphScheme(swigCPtr, this, SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t.getCPtr(scheme));
  }

  public SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t getMorphScheme() {
    long cPtr = nel3dJNI.CPSConstraintMesh_getMorphScheme__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CPSAttribMakerT_float_t(cPtr, false);
  }

  public void hintRotateTheSame(long nbConfiguration, float minAngularVelocity, float maxAngularVelocity) {
    nel3dJNI.CPSConstraintMesh_hintRotateTheSame__SWIG_0(swigCPtr, this, nbConfiguration, minAngularVelocity, maxAngularVelocity);
  }

  public void hintRotateTheSame(long nbConfiguration, float minAngularVelocity) {
    nel3dJNI.CPSConstraintMesh_hintRotateTheSame__SWIG_1(swigCPtr, this, nbConfiguration, minAngularVelocity);
  }

  public void hintRotateTheSame(long nbConfiguration) {
    nel3dJNI.CPSConstraintMesh_hintRotateTheSame__SWIG_2(swigCPtr, this, nbConfiguration);
  }

  public void disableHintRotateTheSame() {
    nel3dJNI.CPSConstraintMesh_disableHintRotateTheSame(swigCPtr, this);
  }

  public long checkHintRotateTheSame(SWIGTYPE_p_float min, SWIGTYPE_p_float max) {
    return nel3dJNI.CPSConstraintMesh_checkHintRotateTheSame(swigCPtr, this, SWIGTYPE_p_float.getCPtr(min), SWIGTYPE_p_float.getCPtr(max));
  }

  public void serial(IStream f) {
    nel3dJNI.CPSConstraintMesh_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public boolean hasTransparentFaces() {
    return nel3dJNI.CPSConstraintMesh_hasTransparentFaces(swigCPtr, this);
  }

  public boolean hasOpaqueFaces() {
    return nel3dJNI.CPSConstraintMesh_hasOpaqueFaces(swigCPtr, this);
  }

  public boolean hasLightableFaces() {
    return nel3dJNI.CPSConstraintMesh_hasLightableFaces(swigCPtr, this);
  }

  public long getNumWantedTris() {
    return nel3dJNI.CPSConstraintMesh_getNumWantedTris(swigCPtr, this);
  }

  public void forceStageModulationByColor(long stage, boolean force) {
    nel3dJNI.CPSConstraintMesh_forceStageModulationByColor(swigCPtr, this, stage, force);
  }

  public boolean isStageModulationForced(long stage) {
    return nel3dJNI.CPSConstraintMesh_isStageModulationForced(swigCPtr, this, stage);
  }

  public void forceVertexColorLighting(boolean force) {
    nel3dJNI.CPSConstraintMesh_forceVertexColorLighting__SWIG_0(swigCPtr, this, force);
  }

  public void forceVertexColorLighting() {
    nel3dJNI.CPSConstraintMesh_forceVertexColorLighting__SWIG_1(swigCPtr, this);
  }

  public boolean isVertexColorLightingForced() {
    return nel3dJNI.CPSConstraintMesh_isVertexColorLightingForced(swigCPtr, this);
  }

  public static void initPrerotVB() {
    nel3dJNI.CPSConstraintMesh_initPrerotVB();
  }

  public void setTexAnimType(CPSConstraintMesh.TTexAnimType type) {
    nel3dJNI.CPSConstraintMesh_setTexAnimType(swigCPtr, this, type.swigValue());
  }

  public CPSConstraintMesh.TTexAnimType getTexAnimType() {
    return CPSConstraintMesh.TTexAnimType.swigToEnum(nel3dJNI.CPSConstraintMesh_getTexAnimType(swigCPtr, this));
  }

  public void setGlobalTexAnim(long stage, SWIGTYPE_p_NL3D__CPSConstraintMesh__CGlobalTexAnim properties) {
    nel3dJNI.CPSConstraintMesh_setGlobalTexAnim(swigCPtr, this, stage, SWIGTYPE_p_NL3D__CPSConstraintMesh__CGlobalTexAnim.getCPtr(properties));
  }

  public SWIGTYPE_p_NL3D__CPSConstraintMesh__CGlobalTexAnim getGlobalTexAnim(long stage) {
    return new SWIGTYPE_p_NL3D__CPSConstraintMesh__CGlobalTexAnim(nel3dJNI.CPSConstraintMesh_getGlobalTexAnim(swigCPtr, this, stage), false);
  }

  public void forceGlobalAnimTimeResetOnNewElement(boolean force) {
    nel3dJNI.CPSConstraintMesh_forceGlobalAnimTimeResetOnNewElement__SWIG_0(swigCPtr, this, force);
  }

  public void forceGlobalAnimTimeResetOnNewElement() {
    nel3dJNI.CPSConstraintMesh_forceGlobalAnimTimeResetOnNewElement__SWIG_1(swigCPtr, this);
  }

  public boolean isGlobalAnimTimeResetOnNewElementForced() {
    return nel3dJNI.CPSConstraintMesh_isGlobalAnimTimeResetOnNewElementForced(swigCPtr, this);
  }

  public boolean isValidBuild() {
    return nel3dJNI.CPSConstraintMesh_isValidBuild(swigCPtr, this);
  }

  public void getShapeNumVerts(SWIGTYPE_p_std__vectorT_int_t numVerts) {
    nel3dJNI.CPSConstraintMesh_getShapeNumVerts(swigCPtr, this, SWIGTYPE_p_std__vectorT_int_t.getCPtr(numVerts));
  }

  public boolean supportGlobalColorLighting() {
    return nel3dJNI.CPSConstraintMesh_supportGlobalColorLighting(swigCPtr, this);
  }

  public void setZBias(float value) {
    nel3dJNI.CPSConstraintMesh_setZBias(swigCPtr, this, value);
  }

  public float getZBias() {
    return nel3dJNI.CPSConstraintMesh_getZBias(swigCPtr, this);
  }

  public final static class TError {
    public final static TError ShapeFileNotLoaded = new TError("ShapeFileNotLoaded", nel3dJNI.CPSConstraintMesh_ShapeFileNotLoaded_get());
    public final static TError ShapeFileIsNotAMesh = new TError("ShapeFileIsNotAMesh", nel3dJNI.CPSConstraintMesh_ShapeFileIsNotAMesh_get());
    public final static TError ShapeHasTooMuchVertices = new TError("ShapeHasTooMuchVertices", nel3dJNI.CPSConstraintMesh_ShapeHasTooMuchVertices_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TError swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TError.class + " with value " + swigValue);
    }

    private TError(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TError(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TError(String swigName, TError swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TError[] swigValues = { ShapeFileNotLoaded, ShapeFileIsNotAMesh, ShapeHasTooMuchVertices };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TTexAnimType {
    public final static TTexAnimType NoAnim = new TTexAnimType("NoAnim", nel3dJNI.CPSConstraintMesh_NoAnim_get());
    public final static TTexAnimType GlobalAnim = new TTexAnimType("GlobalAnim");
    public final static TTexAnimType Last = new TTexAnimType("Last");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTexAnimType swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTexAnimType.class + " with value " + swigValue);
    }

    private TTexAnimType(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTexAnimType(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTexAnimType(String swigName, TTexAnimType swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTexAnimType[] swigValues = { NoAnim, GlobalAnim, Last };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
